package com.hwhhhh.graduationproject.dao.repo;

import com.hwhhhh.graduationproject.dao.entity.CommentLv1Entity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

/**
 * @Description detail
 * Created by Hwhhhh on 2021/3/7 10:33
 */
public interface CommentLv1Repo extends JpaRepository<CommentLv1Entity, Integer> {
    @Query(value = "select c from CommentLv1Entity c where c.isEffective = 1 and c.classroomId = :id order by c.createAt desc")
    Page<CommentLv1Entity> findAllByClassroomIdPageable(@Param("id")int classroomId, Pageable pageable);
}
